package com.ssyt.hiring.web.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ssyt.cdp.common.PageModel;
import com.ssyt.hiring.entity.PositionEntity;
import com.ssyt.hiring.web.dao.PositionDao;

@Service
public class PositionService {

	@Autowired
	private PositionDao positionDao;

	public PageModel<PositionEntity> listAll(String queryStr, int pageNo,
			int pageSize) {
		return positionDao.listAll(queryStr, pageNo, pageSize);
	}

	/**
	 * 发布职位
	 * 
	 * @param position
	 */
	public void addposition(PositionEntity position) {
		positionDao.addposition(position);
	}

	/**
	 * 删除职位
	 * 
	 * @param position
	 */
	public void deleteposition(int positionId) {
		positionDao.deleteposition(positionId);
	}

	/**
	 * 修改前查询职位信息
	 * 
	 * @param positionId
	 * @return
	 */
	public PositionEntity getInfoPosition(int positionId) {
		return positionDao.getInfoPosition(positionId);

	}

	/**
	 * 修改职位信息
	 * 
	 * @param position
	 */
	public void updatePosition(PositionEntity position) {
		positionDao.updatePosition(position);
	}

	/**
	 * 检查发布的职位名是否重复
	 */
	public boolean checkPositionName(String name) {
		return positionDao.checkPositionName(name);
	}

}
